#ifndef _TEST_H_
#define _TEST_H_

#include <iostream>

class A{
public:
	int public_a;
	static int public_static_a;
	void public_a1();
	void set_protected_a1(int a);
	void set_private_a1(int a);
	void set_static_protected_a1(int a);
	void set_static_private_a1(int a);

	void print_all();
	class B{
		public:
		void print_b(){
			std::cout << "---------------------- "<<  std::endl;
			//std::cout << "public_a "<<A::public_a << std::endl; //error
			//std::cout << "protected_a "<<A::protected_a << std::endl; //error
			//std::cout << "private_a "<<A::private_a << std::endl; //error
			std::cout << "public_static_a "<<A::public_static_a << std::endl;
			std::cout << "protected_static_a "<<A::protected_static_a << std::endl;
			std::cout << "private_static_a "<<A::private_static_a << std::endl;
		}
	};
	B m_inner;

protected:
	int protected_a;
	static int protected_static_a;
	void protected_a1();
private:
	int private_a;
	static int private_static_a;
	void private_a1();
};

//error not static
#if 0  
int A::public_a=1;
int A::protected_a=2;
int A::private_a=3;
#endif

int A::public_static_a=1; 
int A::protected_static_a=2; 
int A::private_static_a=3;

void A::public_a1()
{
	std::cout << "-----------public_a1----------- "<< std::endl;
	std::cout << "public_a "<<public_a << std::endl;
	std::cout << "protected_a "<<protected_a << std::endl;
	std::cout << "private_a "<<private_a << std::endl;
	std::cout << "public_static_a "<<public_static_a << std::endl;
	std::cout << "protected_static_a "<<protected_static_a << std::endl;
	std::cout << "private_static_a "<<private_static_a << std::endl;
}

void A::protected_a1()
{
	std::cout << "-----------protected_a1----------- "<< std::endl;
	std::cout << "public_a "<<public_a << std::endl;
	std::cout << "protected_a "<<protected_a << std::endl;
	std::cout << "private_a "<<private_a << std::endl;
	std::cout << "public_static_a "<<public_static_a << std::endl;
	std::cout << "protected_static_a "<<protected_static_a << std::endl;
	std::cout << "private_static_a "<<private_static_a << std::endl;
}

void A::private_a1()
{
	std::cout << "-----------private_a1----------- "<< std::endl;
	std::cout << "public_a "<<public_a << std::endl;
	std::cout << "protected_a "<<protected_a << std::endl;
	std::cout << "private_a "<<private_a << std::endl;
	std::cout << "public_static_a "<<public_static_a << std::endl;
	std::cout << "protected_static_a "<<protected_static_a << std::endl;
	std::cout << "private_static_a "<<private_static_a << std::endl;
}

void A::set_protected_a1(int a)
{
	protected_a = a;
}

void A::set_private_a1(int a)
{
	private_a = a;
}

void A::set_static_protected_a1(int a)
{
	protected_static_a = a;
}

void A::set_static_private_a1(int a)
{
	private_static_a = a;	
}

void A::print_all()
{
	std::cout << "-----------print_all----------- "<< std::endl;
	public_a1();
	protected_a1();
	private_a1();
}
#if 0
class A::B{
public:
	void print_b(){
		std::cout << "-----------public_static_a----------- "<< A::public_static_a<<  std::endl;
	}
};
#endif
#endif